package net.neptech.model.schedule;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.neptech.utils.SnowflakeIdGenerator;
import org.hibernate.annotations.GenericGenerator;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
 * @Author HuangZhengmin
 * @desc  排班规则表实体类
 * @Date 2025/8/12 17:22
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "sche_rule")
public class ScheRule implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;
  @Id
  @GenericGenerator(name = "snowflake", type = SnowflakeIdGenerator.class)
  @GeneratedValue(generator = "snowflake")
  @Column(name = "rule_id", nullable = false)
  private Long ruleId; // 规则ID

  @Column(name = "rule_name", length = 100)
  private String ruleName; // 规则名称

  @Column(name = "rule_type")
  private Integer ruleType; // 规则类型(1-通用规则 2-科室规则 3-个人规则 4-特殊规则)

  @Column(name = "rule_condition", columnDefinition = "json")
  private String ruleCondition; // 规则条件(JSON格式)

  @Column(name = "error_message", length = 200)
  private String errorMessage; // 违反规则提示信息

  @Column(name = "priority")
  private Integer priority = 100; // 规则优先级 百分制%

  @Column(name = "create_time")
  private Date createTime; // 创建时间

  @Column(name = "update_time")
  private Date updateTime; // 更新时间
}
